package com.rbac.utils.commUtils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

//Servlet工具类
public class CommServlet {


    //加载Servlet类
    private static HttpServletRequest getHttpServletRequest(){
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
                .getRequestAttributes())
                .getRequest();
        return request;
    }


    //获取header头指定字符串
    protected String getParamByStr(String str){
        //
        return getHttpServletRequest().getHeader(str);

    }




}
